/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package impss;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mikehood
 */
@Entity
@Table(name = "produce")
@NamedQueries({@NamedQuery(name = "Produce.findAll", query = "SELECT p FROM Produce p"), @NamedQuery(name = "Produce.findByProduceID", query = "SELECT p FROM Produce p WHERE p.produceID = :produceID"), @NamedQuery(name = "Produce.findByPfNumber", query = "SELECT p FROM Produce p WHERE p.pfNumber = :pfNumber"), @NamedQuery(name = "Produce.findByProduceState", query = "SELECT p FROM Produce p WHERE p.produceState = :produceState")})
public class Produce implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "produceID")
    private Integer produceID;
    @Column(name = "pfNumber")
    private Integer pfNumber;
    @Column(name = "produceState")
    private Integer produceState;
    @JoinColumn(name = "phoneID", referencedColumnName = "phoneID")
    @ManyToOne
    private Integer phoneID;
    @JoinColumn(name = "pfID", referencedColumnName = "pfID")
    @ManyToOne
    private Integer pfID;

    public Produce() {
    }

    public Produce(Integer produceID) {
        this.produceID = produceID;
    }

    public Integer getProduceID() {
        return produceID;
    }

    public void setProduceID(Integer produceID) {
        this.produceID = produceID;
    }

    public Integer getPfNumber() {
        return pfNumber;
    }

    public void setPfNumber(Integer pfNumber) {
        this.pfNumber = pfNumber;
    }

    public Integer getProduceState() {
        return produceState;
    }

    public void setProduceState(Integer produceState) {
        this.produceState = produceState;
    }

    public Integer getPhoneID() {
        return phoneID;
    }

    public void setPhoneID(Integer phoneID) {
        this.phoneID = phoneID;
    }

    public Integer getPfID() {
        return pfID;
    }

    public void setPfID(Integer pfID) {
        this.pfID = pfID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (produceID != null ? produceID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Produce)) {
            return false;
        }
        Produce other = (Produce) object;
        if ((this.produceID == null && other.produceID != null) || (this.produceID != null && !this.produceID.equals(other.produceID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "impss.Produce[produceID=" + produceID + "]";
    }

}
